<template>
	<view class="studentFile">
		<view class="listBox">
			<view v-if="pageData.length>0" class="listitem" v-for="(item,index) in pageData"
				@click="handleDetail(item)">
				<view class="topBox">
					<image src="../../static/image/wdsqimg.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
					<view class="" style="margin-left: 20rpx;">
						国家:{{item.country}}
					</view>
				</view>
				<view class="content">
					<view class="contenttop">
						<view class="lable">
							学校
						</view>
						<view class="lable">
							专业
						</view>
						<view class="lable">
							状态
						</view>

					</view>
					<view class="contentBottom" v-for="(subitem,index) in item.information">
						<view class="value">
							{{subitem.school}}
						</view>
						<view class="value">
							{{subitem.speciality}}
						</view>
						<view v-if="subitem.status == 0" class="value" style="color: #8BBEFD;">
							未开始
						</view>
						<view v-if="subitem.status == 1" class="value" style="color: #27D8A6;">
							进行中
						</view>
						<view v-if="subitem.status == 2" class="value" style="color: #FF6F6F;">
							已提交
						</view>

					</view>

				</view>
				<view class="heng"></view>
				<view class="footerBox">
					<view class="">
						查看详情
					</view>
					<u-icon name="arrow-right-double" color="#CCCCCC" size="20"></u-icon>
				</view>
			</view>

			<view v-if="pageData.length==0" class="nullBox">
				<image src="../../static/image/nullimg.png" style="width: 148rpx;height: 148rpx;" mode=""></image>
				<view class="">
					暂无申请
				</view>
			</view>

		</view>

	</view>
</template>

<script>
	import {
		userApplication
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageId: "",
				pageData: [],
			}
		},
		onLoad(options) {
			this.pageId = options.id
			this.handleuserApplication()
		},
		onPullDownRefresh() {
			// console.log("触发了下拉刷新"),
			this.handleuserApplication()
			uni.stopPullDownRefresh();
		},
		methods: {
			async handleuserApplication() {
				let res = await userApplication({
					id: this.pageId
				})
				this.pageData = res.data
			},
			handleDetail(item) {
				uni.navigateTo({
					url: `./applicationDetail?id=${item.id}`
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.studentFile {
		padding: 30rpx;
		box-sizing: border-box;
		.nullBox{
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #AEB8C2;
			line-height: 28rpx;
			width: 148rpx;
			text-align: center;
			margin: 0 auto;
			margin-top: 200rpx;
		}

		.listBox {
			.listitem {
				width: 690rpx;
				// height: 354rpx;
				background: #FFFFFF;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				margin-bottom: 30rpx;

				.topBox {
					width: 690rpx;
					height: 92rpx;
					background: #E1E8FD;
					border-radius: 16rpx 16rpx 0 0;
					padding: 22rpx 20rpx;
					box-sizing: border-box;
					display: flex;
					align-items: center;
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #255A9B;
					line-height: 32rpx;
				}

				.content {
					padding: 30rpx;
					box-sizing: border-box;

					.contenttop {
						display: flex;
						text-align: center;

						.lable {
							width: 33.33%;
							font-size: 28rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #232832;
							line-height: 36rpx;
						}

					}

					.contentBottom {
						display: flex;
						margin-top: 30rpx;

						.value {
							font-size: 28rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #9E9E9E;
							line-height: 36rpx;
							width: 33.33%;
							text-align: center;
						}
					}
				}

				.heng {
					width: 650rpx;
					height: 1rpx;
					background-color: #F4F4F7;
					margin: 0 auto;
				}

				.footerBox {
					padding: 30rpx 60rpx;
					box-sizing: border-box;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #CCCCCC;
					line-height: 28rpx;
				}

			}
		}

	}
</style>